/*
 * @Author: 梓岄 3049738225@qq.com
 * @Date: 2025-11-30 14:23:47
 * @LastEditors: 梓岄 3049738225@qq.com
 * @LastEditTime: 2025-11-30 14:31:25
 * @FilePath: /251130_signal/test1.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include<iostream>
#include<signal.h>


void sigcb(int signo)
{
    std::cout<<"接收到信号："<<signo<<std::endl;
}


int main()
{
    sighandler_t handl=signal(SIGINT,sigcb);

    while (true)
    {
        std::cout<<"进程正在运行，pid: "<<getpid()<<std::endl;
        sleep(1);
    }

    return 0;
}